package org.one.afternoon.service.impl;

import org.one.afternoon.domain.Example;
import org.one.afternoon.mapper.ExampleMapper;
import org.one.afternoon.service.ExampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExampleServiceImpl implements ExampleService {
    @Autowired
    private ExampleMapper exampleMapper;


    @Override
    public Example addOne(Example example) {
        exampleMapper.insertOne(example);
        //添加用户信息成功
        return example;
    }

    @Override
    public Example updateOne(Example example) {
        exampleMapper.updateOne(example);
        //修改用户信息成功！
        return example;
    }

    @Override
    public List<Example> findAll() {
        return exampleMapper.findAllOne();
    }


    @Override
    public void deleteOne(Integer index) {
        exampleMapper.deleteUserById(index);
        //删除成功!
    }

    @Override
    public List<Example> findOne(Example example) {
        return exampleMapper.findOne(example);
    }
}
